package com.lagou.rpc.consumer;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.client.RpcClient;
import com.lagou.rpc.consumer.proxy.RpcClientProxy;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * SpringBoot启动类
 */
@SpringBootApplication
public class ClientBootStrapApplication{//} implements CommandLineRunner {

//    @Autowired
//    RpcClientProxy rpcClientProxy;

    public static void main(String[] args) {
        SpringApplication.run(ClientBootStrapApplication.class, args);
    }

//    @Override
//    public void run(String... args) throws Exception {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                rpcClientProxy.initClient("127.0.0.1", 8899);
//            }
//        }).start();
//    }


//    public static void main(String[] args) {
//        IUserService userService = (IUserService) RpcClientProxy.createProxy(IUserService.class);
//        User user = userService.getById(2);
//        System.out.println(user);
//    }
}
